package com.test.xshang.reflect;


/**
 * @BelongsProject: simpleframework
 * @BelongsPackage: com.Xshang.reflect
 * @Author: xshang
 * @CreateTime: 2023-06-23  19:27
 * @Description: TODO
 * @Version: 1.0
 */
public class ReflectTarget {

    public String name;

    protected int index;

    char type;

    private String targetInfo;

    @Override
    public String toString() {
        return "ReflectTarget{" +
                "name='" + name + '\'' +
                ", index=" + index +
                ", type=" + type +
                ", targetInfo='" + targetInfo + '\'' +
                '}';
    }

    // 成员方法
    public void show1(String s) {
        System.out.println("调用了公有的成员方法 show1 参数为:" + s);
    }

    public void show2() {
        System.out.println("调用了公有的无参成员方法");
    }

    void  show3() {
        System.out.println("调用了默认修饰符的无参成员方法show3");
    }

    private String show4(int index) {
        System.out.println("调用了私有的，并且有返回值的，int参数show4 : index:{" + index + "}");
        return "show4Result";
    }

    // 构造函数  默认修饰符 包可见
    ReflectTarget(String str) {
        System.out.println("包可见的有参构造..." + str);
    }

    public ReflectTarget() {
        System.out.println("public无参构造...");
    }

    public ReflectTarget(Integer age) {
        System.out.println("公有的有参构造..age:" + age);
    }

    public ReflectTarget(String name,Integer age) {
        System.out.println("多个参数的公有构造.." + name +"-"+ age);
    }

    protected ReflectTarget(boolean n) {
        System.out.println("受保护的构造方法..." + n);
    }

    private ReflectTarget(char n) {
        System.out.println("私有的构造方法..." + n);
    }

}
